package com.guanghua.brick.html.tag;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class CoreOutTag extends BodyTagSupport {
	
private static Log logger = LogFactory.getLog(CoreOutTag.class);
	
	private String data = null;
	private String dft = null;
	private boolean escape = false;

	public int doEndTag() throws JspException {
		if (data == null) data = dft;
		if (escape) {
			
		}
		try {
			pageContext.getOut().write(data);
		} catch (IOException e) {
			logger.error("io exception on print out tag", e);
		}
		
		return BodyTagSupport.EVAL_PAGE;
	}
	
	public boolean isEscape() {
		return escape;
	}

	public void setEscape(boolean escape) {
		this.escape = escape;
	}

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public String getDefault() {
		return dft;
	}

	public void setDefault(String dft) {
		this.dft = dft;
	}
}
